package com.zhenwei.zscm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhenwei.zscm.entity.SequencesEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ISequencesMapper extends BaseMapper<SequencesEntity> {
    @Update("UPDATE sequences SET current_value = current_value + increment_by WHERE use_for = #{useFor}")
    @Options(useGeneratedKeys = true, keyProperty = "currentValue")
    void updateCurrentValue(String useFor);
}
